how to make a file and write to it writing to a text file